<!-- addEditDept.html 2017-08-25 09:18:08-->
<div class="ibox">
	<div class="ibox-title">
		<h5>部门编辑</h5>
		<div class="pull-right">
			#if(authDept.id) <a href="javascript:" style="font-size:12px;color:#666" onclick="add(#(authDept.id))">新增子部门</a>  
			<a href="javascript:" style="font-size:12px;color:#666" onclick="add(#(authDept.parent_id))">新增同级部门</a>  #end
   		<a href="javascript:" style="font-size:12px;color:#666" onclick="closeEdit()">关闭</a>
    </div>
	</div>
	<div class="ibox-content">
		<form id="form" class="form-horizontal required-validate" method="post" action="saveDept" novalidate="novalidate" onsubmit="return validateCallback(this,thisAjaxDone)">
			<input type="hidden" name="authDept.id" value="#(authDept.id)"/>
			<input type="hidden" name="authDept.parent_id" value="#(authDept.parent_id)"/>
			<div class="form-group">
		   	<label class="col-xs-2 control-label">上级部门：</label>
		     <div class="col-xs-9" style="line-height: 35px">
		     #if(parentDept)#(parentDept.name)#else无#end
		     </div>
		  </div>
			#if(parentDept)
				<input type="hidden" name="authDept.portal" value="#(parentDept.portal)"/>
			#else
				#if(authDept.id)
					<div class="form-group">
				   	<label class="col-xs-2 control-label">部门ID：</label>
				     <div class="col-xs-9" style="line-height: 35px">
				     #(authDept.id)
				     </div>
				  </div>
					<div class="form-group">
				   	<label class="col-xs-2 control-label">平台：</label>
				     <div class="col-xs-9" style="line-height: 35px">
				     #(data("AUTH_PORTAL",authDept.portal))
				     </div>
				  </div>
					<input type="hidden" name="authDept.portal" value="#(authDept.portal)"/>
				#else
					<div class="form-group">
						<label class="col-xs-2 control-label">平台：</label>
						<div class="col-xs-9">
							<select name="authDept.portal" class="form-control required">
								#(data("AUTH_PORTAL","option",authDept.portal))
							</select>
						</div>
					</div>	
		  	#end	
		  #end		
			<div class="form-group">
				<label class="col-xs-2 control-label">名称：</label>
				<div class="col-xs-9">
	<input type="text" class="form-control required" name="authDept.name" value="#(authDept.name)"/>
				</div>
			</div>			
			<div class="form-group">
				<label class="col-xs-2 control-label">排序：</label>
				<div class="col-xs-9">
		<input type="text" class="form-control digits required" name="authDept.sort" value="#(authDept.sort??"100")"/>
				</div>
			</div>			
			<div class="form-group">
				<label class="col-xs-2 control-label">状态：</label>
				<div class="col-xs-9">
		#for(item:data("ENABLE_FLAG"))
		<label style="font-weight:normal;line-height: 37px;margin-bottom: 0px;padding-right: 5px"><input class="required" type="radio" name="authDept.enable_flag" #if(authDept.enable_flag)#if(authDept.enable_flag==item.key)checked="checked"#end#elseif(item.key=="T")checked="checked"#end value="#(item.key)"/> #(item.value.name) </label>
		#end
				</div>
			</div>		  <div class="form-group">
		   	<div class="col-xs-9 col-xs-offset-2">
		     	<button type="submit" class="btn btn-primary">保存</button>
		     	#if(authDept.id)
		     		<a class="btn btn-danger" href="deleteDept?id=#(authDept.id)" target="ajaxTodo" title="确定删除吗？" callback="deleteAjaxTodo">删除</a>
		     		<a class="btn btn-primary" onclick="layer.open({area: ['550px', '500px'],content: 'editDeptUser?id=#(authDept.id)',type: 2,title: '部门人员'});" href="javascript:;">部门人员</a>
		     	#end
		    </div>
		  </div>
		</form>
 	</div>
</div>